package com.yanqu.road.server.cmd.activity.yearMaster;

import com.yanqu.road.pb.yearMaster.YearMasterProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.yearMaster.YearMasterMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;


@Cmd(code = CrossProtocol.C2_CROSS_YEAR_MASTER_ATTACK, desc = "瑞兽降福活动攻击boss")
public class CrossYearMasterAttackCmd extends CrossCommand {
    long userId;
    int activityId;
    long score;
    int gridType;
    int gridNum;
    String removeGrid;
    int mode;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        YearMasterProto.CrossAttackBossReqMsg reqMsg = YearMasterProto.CrossAttackBossReqMsg.parseFrom(packet.getBytes());
        userId = reqMsg.getUserId();
        activityId = reqMsg.getActivityId();
        score = reqMsg.getScore();
        gridType = reqMsg.getGridType();
        gridNum = reqMsg.getGridNum();
        removeGrid = reqMsg.getRemoveGrid();
        mode= reqMsg.getGameMode();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        YearMasterMgr.attackBoss(userId, activityId, score, gridType, serverId,gridNum,mode,removeGrid);
    }

    @Override
    public void sendData() {

    }
}
